<!DOCTYPE html>
<html lang="en" xmlns:v-slot="http://www.w3.org/1999/XSL/Transform">

<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no">
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta content="always" name="referrer">
    <title>Lucky-Wheel</title>
    <meta name="description" content="欢迎参与我们的免费幸运大转盘抽奖活动！">
    <meta name="image" content="https://typecho.scoremaster.top/wheel.png">
    <link rel="shortcut icon" href="https://stc-developers.zdn.vn/static/v3/images/favicon.ico">
    <script src="plugins/vue/dist/vue.min.js"></script>
    <!--导入vue和axios-->
    <script src="plugins/axios/dist/axios.js"></script>
    <script src="js/common.js"></script>
    <script src="js/element/element.js"></script>
    <script src="js/uuid.min.js"></script>
    <script src="js/sdk.js"></script>
    <script src="js/vue-composition-api.prod.js"></script>
    <script src="js/vue-demi@0.11.4.js"></script>
    <script src="js/vue@0.1.11.js"></script>
    <script type="text/javascript" src="js/NativeShare.js"></script>
    <script src="js/jsencrypt.js"></script>
    <script src="js/jquery.js" charset="UTF-8"></script>
    <link rel="stylesheet" href="css/style.css">
    <link rel="stylesheet" href="js/element/element.css">
    <style>
        .container2 {
            margin: 20px;
            padding: 20px;
            border: 1px solid #ccc;
        }
        .zalo-share-button {
            padding: 10px 20px;
            background-color: #0084ff;
            color: white;
            border: none;
            border-radius: 5px;
            cursor: pointer;
        }

    </style>
</head>

<body>
<script type="text/javascript">
    function shareSuccess(){
        console.log("快去通知好友吧")
    }
</script>

<div class="container" id="app" v-cloak>
    <h1>免费抽大奖</h1>
    <div class="rules" style="height: auto;width: auto;margin-bottom: 50px">
        <button class="rules-button" @click="showRules = true">活动规则</button>
    </div>
    <div class="rules-popup" v-if="showRules">
        <div class="rules-content">
            <h2>活动规则</h2>
            <p>欢迎参与我们的免费幸运大转盘抽奖活动！请仔细阅读以下规则以确保您了解参与方式：</p>
            <ol>
                <li><strong>活动时间：</strong>从即日起至2023年12月31日。</li>
                <li><strong>参与资格：</strong>所有参与者必须年满18岁，并同意通过电子邮件接收来自我们的通知。</li>
                <li><strong>如何参与：</strong>
                    <ul>
                        <li>访问活动页面。</li>
                        <li>点击“开始”按钮启动幸运大转盘。</li>
                        <li>转盘停止后，系统将随机显示您可能获得的奖品。</li>
                    </ul>
                </li>
                <li><strong>奖品：</strong>奖品包括iPhone 15、优惠券、谢谢参与等。每位用户仅有一次免费抽奖机会。</li>
                <li><strong>领奖办法：</strong>获得iPhone 15或其他实物奖品的用户需完成一个简单的验证过程，包括邀请3位好友助力。完成助力后，奖品将在30个工作日内发放。</li>
                <li><strong>注意事项：</strong>
                    <ul>
                        <li>每位用户仅限参与一次。</li>
                        <li>奖品不得兑换为现金或其他商品。</li>
                        <li>参与本次活动即表示您同意我们的隐私政策和活动条款。</li>
                    </ul>
                </li>
            </ol>
            <p>本活动最终解释权归活动组织者所有。</p>
            <button @click="showRules = false">关闭</button>
        </div>
    </div>


    <lucky-wheel ref="myLucky" width="300px" height="300px" :prizes="prizes" :blocks="blocks" :buttons="buttons"
                 @start="startCallback" @end="endCallback" id="my-lucky" v-show="wheelFlag">
    </lucky-wheel>

    <div class="countPrize" v-show="wheelFlag">恭喜您获得{{numPrizes}}次免费抽奖机会</div>
    <div id="iphone15" v-show="JSON.parse(iphoneFlag)===true">
        <img src="https://typecho.scoremaster.top/wheel.png"
             alt="iphone-15" class="iphone15" v-show="false">
        <img src="https://www.apple.com/hk/iphone-15/images/overview/closer-look/all_colors__d4w03v51nwcy_large.jpg"
             alt="iphone-15" class="iphone15">
        <div class="shareTip">
            <h3>恭喜获得iPhone 15大奖</h3>
            <div class="shareContainer">
                <p>接下来只需要邀请 {{LuckyShare.verifyCount == null ? 0 : LuckyShare.verifyCount}} / 3 个好友助力，即可免费领取iPhone 15</p>
                <div v-if="show1"><el-button @click="shareHandler()" :loading="loading3">立即邀请</el-button></div>
                <div v-else><a @click="showInfo()">立即领取</a></div>
            </div>
        </div>
    </div>

    <div class="zalo-share-popup" v-if="showZaloPopup">
        <div class="popup-content">
            <button class="close-button" @click="showZaloPopup = false">&times;</button>
            <h2 style="margin-top: 2px">分享到Zalo群</h2>
            <p style="margin-top: 2px">请按以下步骤分享到Zalo群，邀请好友助力：</p>
            <ol style="text-align: center;margin-top: 2px">
                <li>打开Zalo应用。</li>
                <li>进入您想分享的群聊。</li>
                <li>将下面的链接粘贴到聊天框中，然后发送。</li>
            </ol>
            <el-input type="text" readonly :value="shareUrl" class="share-url-input">
                <template v-slot:append>
                    <el-button icon="el-icon-document-copy" @click="copyText(1)" :loading="loading1">复制</el-button>
                </template>
            </el-input>
            <p style="margin-top: 2px; font-size: 18px;">或者</p>
            <p style="margin-top: 5px">点击下面的分享按钮，选择Zalo应用，进行分享。</p>
            <div class="container2">
                <el-button id="zaloShareButton" class="zalo-share-button"
                           data-oaid="3853758560685742933" data-layout="1" data-image="https://typecho.scoremaster.top/wheel.png" data-callback="shareSuccess"
                           data-color="blue" data-customize="true" data-href="shareUrl" @click="handleShareSuccess" :loading="loading2">分享</el-button>
            </div>
        </div>
    </div>

    <div class="share-successful-popup" v-if="showShareSuccess">
        <div class="popup-content5">
            <p>复制成功！快去通知您的朋友帮您助力吧！</p>
            <button @click="showShareSuccessFlush()">关闭</button>
        </div>
    </div>

    <div class="share-successful-popup" v-if="showShareSuccess2">
        <div class="popup-content5">
            <p>分享成功！快去通知您的朋友帮您助力吧！</p>
            <button @click="showShareSuccessFlush()">关闭</button>
        </div>
    </div>

    <div class="help-successful-popup" v-if="JSON.parse(showHelpSuccessFul) === true">
        <div class="popup-content10">
            <button class="close-button" @click="showHelpSuccessFul ='false'">&times;</button>
            <h2>恭喜您完成任务！</h2>
            <p style="margin-bottom: 15px">请填写以下相关信息，以便我们发货。</p>
            <el-form :model="user" status-icon ref="ruleForm" label-width="100px" class="demo-ruleForm">
                <el-form-item label="姓名" prop="uname">
                    <el-input type="text" v-model="user.uname" autocomplete="off"></el-input>
                </el-form-item>
                <el-form-item label="省份" prop="province">
                    <el-input type="text" v-model="user.province" autocomplete="off"></el-input>
                </el-form-item>
                <el-form-item label="城市" prop="city">
                    <el-input v-model.text="user.city"></el-input>
                </el-form-item>
                <el-form-item label="地址" prop="address">
                    <el-input v-model.text="user.address"></el-input>
                </el-form-item>
                <el-form-item label="邮箱" prop="email">
                    <el-input v-model.email="user.email"></el-input>
                </el-form-item>
                <el-form-item label="电话" prop="mobile">
                    <el-input v-model.phone="user.mobile"></el-input>
                </el-form-item>
                <p class="sell-phone-error" style="display:block;color: red;margin: 2px" v-text="errorMsg">请填写正确的手机号码</p>
                <el-form-item>
                    <el-button type="primary" @click.prevent="submitHandler()">提交</el-button>
                    <el-button @click="resetForm('user')">重置</el-button>
                </el-form-item>
            </el-form>
        </div>
    </div>

    <div class="progress" v-show="JSON.parse(progressFlag) === true">
        <img src="https://www.apple.com/hk/iphone-15/images/overview/closer-look/all_colors__d4w03v51nwcy_large.jpg"
             alt="iphone-15" class="iphone15">
        <p>领取奖品的用户人数很多，发货需要排队等待，如果需要加急发货，可以邀请好友助力</p>
        <div id="progress">
            <div id="fillContent" :style="{width: progressPercentage + '%'}"></div>
            <p id="percent">{{ progressPercentage.toFixed(0) }}%</p>
        </div>
        <div class="shareContainer">
            <p>前方还有<a style="color: red">{{lineupNum}}</a>...人正在排队中</p>
            <div>
                <!-- Show this button only if the progress is not complete -->
                <el-button v-if="!isComplete" class="shareBtn" @click="shareHandler2()" :loading="loading3">立即邀请助力</el-button>
                <!-- Show this button only when the progress is complete -->
                <el-button v-else class="shareBtn" @click="initiateShipping()">立即发货</el-button>
            </div>
        </div>
    </div>

    <div class="prizeWinList">
        <div class="prizeWinListContainer">
            <h2><span>中奖名单</span></h2>
            <div id="detetion-box2">
                <ul id="detetion-con1">
                    <li v-for="(item, index) in prizeWinList" :key="index">
                        <div><img :src="item.src" alt=""><em>{{item.uname}}</em></div>
                        <span>{{item.prize}}</span></li>
                </ul>
                <ul id="detetion-con2"></ul>
            </div>
        </div>
    </div>

    <div id="mask" v-show="maskFlag">
        <div class="notify">
            <div class="prizeContainer" v-show="prizeFlag">
                <div>
                    <p>恭喜抽中大奖</p>
                    <em>iPhone 15</em>免费拿
                </div>
                <a @click='goiPhoneHandler()'>点击领取</a>
            </div>
        </div>
    </div>

    <div v-if="showShippingModal" class="modal">
        <div class="modal-content">
            <button class="close-button" @click="closeModal()">&times;</button>
            <h2 style="margin-bottom: 5px">您的手机已经开始打包了</h2>
            <ul>
                <li v-for="(log, index) in trackingLogs" :key="index">
                    <span :style="{ color: log.shown ? 'black' : '#aaa' }">{{ log.event }}</span>
                    <el-icon v-if="!log.shown && !allLogsDisplayed" :style="{ marginLeft: '10px' }" name="loading"></el-icon>
                </li>
            </ul>
            <p>提示：由于活动人数较多，我们已为你加急发货，请稍候再来查看物流信息</p>
        </div>
    </div>

    <div class="zalo-share-popup3" v-if="showZaloPopup3">
        <div class="popup-content">
            <button class="close-button" @click="showZaloPopup3 = false">&times;</button>
            <h2 style="margin-top: 2px">还差一步就可以领手机了</h2>
            <p style="margin-top: 2px">请按以下步骤分享到Zalo群，邀请好友助力：</p>
            <ol style="text-align: center;margin-top: 2px">
                <li>打开Zalo应用。</li>
                <li>进入您想分享的群聊。</li>
                <li>将下面的链接粘贴到聊天框中，然后发送。</li>
            </ol>
            <el-input type="text" readonly :value="shareUrl" class="share-url-input">
                <template v-slot:append>
                    <el-button icon="el-icon-document-copy" @click="copyText(2)" :loading="loading1">复制</el-button>
                </template>
            </el-input>
            <p style="margin-top: 2px; font-size: 18px;">或者</p>
            <p style="margin-top: 5px">点击下面的分享按钮，选择Zalo应用，进行分享。</p>
            <div class="container2">
                <el-button id="zaloShareButton" class="zalo-share-button"
                           data-oaid="3853758560685742933" data-layout="1"
                           data-color="blue" data-customize="true" data-href="shareUrl" @click="handleShareSuccess2" :loading="loading2">分享</el-button>
            </div>
        </div>
    </div>


    <div class="help-successful-popup9" v-if="showSelf">
        <div class="popup-content9">
            <h2>助力失败！</h2>
            <p>您不能给自己助力！</p>
            <button type="button" @click="closeSelf()">关闭</button>
        </div>
    </div>

    <div class="help-successful-popup3" v-if="canAssist">
        <div class="popup-content3">
            <h2>还差一步就可以助力了！</h2>
            <p>点击开始抽奖，即可帮助好友助力！</p>
            <button @click="canAssist = false">关闭</button>
        </div>
    </div>

    <div class="help-successful-popup3" v-if="openFirstStage">
        <div class="popup-content3">
            <h2>由于你已经玩过游戏了</h2>
            <p>你可以直接点击助力，即可帮助好友助力！</p>
            <el-button @click="closeFirstStage()" :loading="isLoading">助力</el-button>
        </div>
    </div>

    <div class="help-successful-popup6" v-if="can_t_assist">
        <div class="popup-content6">
            <h2>助力失败！</h2>
            <p>您已经帮别人助力过咯哦！</p>
            <button @click="cantAssist()">关闭</button>
        </div>
    </div>

    <div class="help-successful-popup4" v-if="showIt">
        <div class="popup-content4">
            <h2>助力失败！</h2>
            <p>您已经帮助他助力过了！</p>
            <button @click="closeIt()">关闭</button>
        </div>
    </div>

    <div class="help-successful-popup7" v-if="invalid">
        <div class="popup-content7">
            <h2>助力失败！</h2>
            <p>该分享链接已经过期了！</p>
            <button @click="urlInvalid()">关闭</button>
        </div>
    </div>

    <div class="help-successful-popup" v-if="showHelpSuccess">
        <div class="popup-content2">
            <h2>助力成功！</h2>
            <p>感谢您帮助您的朋友！</p>
            <button @click="showHelpSuccessful()">关闭</button>
        </div>
    </div>

    <div class="help-successful-popup" v-if="showHelpSuccessJump">
        <div class="popup-content2">
            <h2>助力成功！</h2>
            <p>感谢您帮助您的朋友！</p>
            <button @click="closeHelpSuccessJump()">关闭</button>
        </div>
    </div>

    <div class="help-successful-popup" v-if="showHelpSuccessNoJump">
        <div class="popup-content2">
            <h2>助力成功！</h2>
            <p>感谢您帮助您的朋友！</p>
            <button @click="showHelpSuccessNoJump = false">关闭</button>
        </div>
    </div>

    <div class="help-successful-popup4" v-if="openError">
        <div class="popup-content4">
            <h2>网络异常</h2>
            <p>请稍后再试！</p>
            <button @click="closeError()">关闭</button>
        </div>
    </div>

    <div class="help-successful-popup12" v-if="showDelivery">
        <div class="popup-content12">
            <h2>温馨提示：您的好友的奖品马上就可以发货了</h2>
            <p>快帮他助力吧</p>
            <el-button @click="closeDelivery()" :loading="isLoading">助力</el-button>
        </div>
    </div>

    <el-alert
            title="成功提示的文案"
            type="success"
            center
            show-icon v-show="isShow">
    </el-alert>

</div>

<script type="text/javascript">
    new Vue({
        el: "#app",
        data: {
            showShareSuccess2:false,
            isShow:false,
            baseShareUrl:null,
            loadingInstance: null,
            loading3:true,
            openFirstStage:false,
            showIt:false,
            isLoading:false,
            showDelivery:false,
            showHelpSuccessNoJump:false,
            openError:false,
            showHelpSuccess:false,
            invalid:false,
            can_t_assist:false,
            canAssist:false,
            showSelf:false,
            noPlay:false,
            showZaloPopup2:false,
            showZaloPopup3:false,
            prizeFlag: true,
            lineupNum: 23333,
            showShippingModal: false,
            trackingLogs: [
                { event: "订单已接收", shown: false, time: Date.now() },
                { event: "商品正在打包中", shown: false, time: Date.now() + 10 * 60 * 1000 }, // 10 minutes later
                { event: "商品已出库，等待发货", shown: false, time: Date.now() + 20 * 60 * 1000 }, // 20 minutes later
                { event: "商品已交付物流", shown: false, time: Date.now() + 30 * 60 * 1000 } // 30 minutes later
            ],
            allLogsDisplayed: false,
            isPlayed : false,
            lastUpdateTime: null,
            LuckyShare: {
                inviteCode: null,
                verifyCount: null,
                expire: false,
                mi: null,
                submitParam: false,
                inviteParam:{
                    id:null,
                    count2:null,
                    effectiveCount:null,
                    invitedCode:null,
                    parentId:null,
                },
                secondStage:null,
                firstStage:null,
            },
            show1:true,
            maskFlag:false,
            progressFlag:false,
            errorMsg:'',
            user: {
                id: null,
                uname: null,
                province: null,
                city: null,
                address: null,
                email: null,
                mobile: null,
                inviteCode: null,
            },
            showHelpSuccessFul:false,
            showShareSuccess:false,
            loading1:false,
            loading2:false,
            shareUrl:'',
            showZaloPopup:false,
            iphoneFlag: false,
            numPrizes: 3,
            numFriends:3,
            showRules:false,
            wheelFlag:true,
            blocks: [
                {padding: '10px', background: '#9e3a05'}
            ],
            prizes: [
                {background: '#faa300', fonts: [{id: 0, text: '谢谢惠顾', fontSize: 14, top: 10}]},
                {background: '#fecaa3', fonts: [{id: 1, text: 'iPhone 15', fontSize: 14, top: 10}]},
                {background: '#faa300', fonts: [{id: 2, text: '谢谢惠顾', fontSize: 14, top: 10}]},
                {background: '#fecaa3', fonts: [{id: 3, text: '谢谢惠顾', fontSize: 14, top: 10}]},
                {background: '#faa300', fonts: [{id: 4, text: 'iPhone 15 pro', fontSize: 14, top: 10}]},
                {background: '#fecaa3', fonts: [{id: 5, text: '谢谢惠顾', fontSize: 14, top: 10}]},
            ],
            buttons: [
                {radius: '40%', background: '#faa300'},
                {radius: '35%', background: '#fecaa3'},
                {
                    radius: '30%', background: '#9e3a05',
                    pointer: true,
                    fonts: [{text: '开始', top: '-10px'}]
                }
            ],
            prizeWinList: [
                {
                    src: 'https://wxapp.tc.qq.com/275/20304/stodownload?m=cd1320414cbe406fdc181a4a87bac44b&filekey=30350201010421301f02020113040253480410cd1320414cbe406fdc181a4a87bac44b020300be7a040d00000004627466730000000132&hy=SH&storeid=264787b54000be6e6000000000000011300004f5053481a3e1b01e6561004e&bizid=1023',
                    uname: '1***0',
                    prize: 'iPhone 15'
                },
                {
                    src: 'https://wxapp.tc.qq.com/275/20304/stodownload?m=f232c65bedac7f9d78c95cdb7d6a5a5c&filekey=30350201010421301f02020113040253480410f232c65bedac7f9d78c95cdb7d6a5a5c020300b867040d00000004627466730000000132&hy=SH&storeid=264784f39000465a4000000000000011300004f50534828d148e0b6500fd9a&bizid=1023',
                    uname: '1***0',
                    prize: '谢谢惠顾'
                },
                {
                    src: 'https://wxapp.tc.qq.com/275/20304/stodownload?m=cd1320414cbe406fdc181a4a87bac44b&filekey=30350201010421301f02020113040253480410cd1320414cbe406fdc181a4a87bac44b020300be7a040d00000004627466730000000132&hy=SH&storeid=264787b54000be6e6000000000000011300004f5053481a3e1b01e6561004e&bizid=1023',
                    uname: '1***0',
                    prize: 'iPhone 15 pro'
                },
                {
                    src: 'https://wxapp.tc.qq.com/275/20304/stodownload?m=f232c65bedac7f9d78c95cdb7d6a5a5c&filekey=30350201010421301f02020113040253480410f232c65bedac7f9d78c95cdb7d6a5a5c020300b867040d00000004627466730000000132&hy=SH&storeid=264784f39000465a4000000000000011300004f50534828d148e0b6500fd9a&bizid=1023',
                    uname: '1***0',
                    prize: '谢谢惠顾'
                },
                {
                    src: 'https://wxapp.tc.qq.com/275/20304/stodownload?m=f232c65bedac7f9d78c95cdb7d6a5a5c&filekey=30350201010421301f02020113040253480410f232c65bedac7f9d78c95cdb7d6a5a5c020300b867040d00000004627466730000000132&hy=SH&storeid=264784f39000465a4000000000000011300004f50534828d148e0b6500fd9a&bizid=1023',
                    uname: '1***0',
                    prize: 'iPhone 15'
                },
                {
                    src: 'https://wxapp.tc.qq.com/275/20304/stodownload?m=f232c65bedac7f9d78c95cdb7d6a5a5c&filekey=30350201010421301f02020113040253480410f232c65bedac7f9d78c95cdb7d6a5a5c020300b867040d00000004627466730000000132&hy=SH&storeid=264784f39000465a4000000000000011300004f50534828d148e0b6500fd9a&bizid=1023',
                    uname: '1***0',
                    prize: '谢谢惠顾'
                },
                {
                    src: 'https://wxapp.tc.qq.com/275/20304/stodownload?m=f232c65bedac7f9d78c95cdb7d6a5a5c&filekey=30350201010421301f02020113040253480410f232c65bedac7f9d78c95cdb7d6a5a5c020300b867040d00000004627466730000000132&hy=SH&storeid=264784f39000465a4000000000000011300004f50534828d148e0b6500fd9a&bizid=1023',
                    uname: '1***0',
                    prize: '谢谢惠顾'
                },
                {
                    src: 'https://wxapp.tc.qq.com/275/20304/stodownload?m=cd1320414cbe406fdc181a4a87bac44b&filekey=30350201010421301f02020113040253480410cd1320414cbe406fdc181a4a87bac44b020300be7a040d00000004627466730000000132&hy=SH&storeid=264787b54000be6e6000000000000011300004f5053481a3e1b01e6561004e&bizid=1023',
                    uname: '1***0',
                    prize: 'iPhone 15 pro'
                },
            ],
            decrementIntervalId:null,
            submitParam:false,
            randomData:[],
            notRandomData:[],
            default:'',
            currentProgress: 0,
            totalLineup: 100,
            InviteParam:{
                invitedCode:null,
                count:null,
                effectiveCount:null,
            },
            isFirstPlay:false,
            speed: 50,
            showHelpSuccessJump:false,
        },
        methods: {
            resetForm() {
                this.user = {
                    id: null,
                    uname: null,
                    province: null,
                    city: null,
                    address: null,
                    email: null,
                    mobile: null,
                    inviteCode: null,
                }
            },
            showShareSuccessFlush(){
                this.showShareSuccess = false
                this.showShareSuccess2 = false
            },
            startLoading() {
                this.loadingInstance = this.$loading({
                    lock: true,
                    text: '加载中...',
                    spinner: 'el-icon-loading',
                    background: 'rgba(0, 0, 0, 0.7)'
                });
            },
            stopLoading() {
                if (this.loadingInstance) {
                    this.loadingInstance.close();
                }
            },
            closeFirstStage(){
                this.isLoading = true;
                this.firstHelp();
            },
            firstHelp(){
                const url = parseParamObj(window.location.href);
                if (url != ""){
                    let withExpiry = this.getWithExpiry("shareUrl")
                    let parseParamObj = {
                        ref : withExpiry,
                        ref2 : url.ref
                    }
                    let s = RsA_encryption(parseParamObj)
                    this.$http.put("/lucky/check",s).then(res => {
                        let {data, success} = res.data;
                        console.log("/lucky/check",res.data)
                        if (success){
                            if (data == "effective"){
                                this.isLoading = false;
                                this.openFirstStage = false;
                                this.showHelpSuccessJump = true
                            }
                        }else {
                            this.openError = true;
                        }
                    })
                }
            },
            closeHelpSuccessJump(){
                this.showHelpSuccessJump = false;
                const url = window.location.search;
                if (url !== ""){
                    window.location.replace(window.location.origin + window.location.pathname);
                }
            },
            closeIt(){
                this.showIt = false;
                const url = window.location.search;
                if (url !== ""){
                    window.location.replace(window.location.origin + window.location.pathname);
                }
            },
            deliveryAssistance(){
                //请求后端增加助力人数
                const url = parseParamObj(window.location.href);
                if (url != ""){
                    let withExpiry = this.getWithExpiry("shareUrl")
                    let parseParamObj = {
                        ref : withExpiry,
                        ref2 : url.ref
                    }
                    let s = RsA_encryption(parseParamObj)
                    this.$http.put("/lucky/check2",s).then(res => {
                        let {data, success} = res.data;
                        console.log("/lucky/check2",res.data)
                        if (success){
                            if (data == "effective"){
                                this.loading = false;
                                this.showDelivery = false;
                                this.showHelpSuccessJump = true;
                            }
                        }else {
                            this.loading = false;
                            this.showDelivery = false;
                            this.openError = true;
                        }
                    })
                }else {
                    this.$message.error("参数错误")
                }
            },
            closeDelivery(){
                this.isLoading = true
                this.deliveryAssistance();
            },
            closeError(){
                this.openError = false;
                const url = window.location.search;
                if (url !== ""){
                    window.location.replace(window.location.origin + window.location.pathname);
                }
            },
            showHelpSuccessful(){
                this.showHelpSuccess = false;
                const url = window.location.search;
                if (url !== ""){
                    window.location.replace(window.location.origin + window.location.pathname);
                }
            },
            cantAssist(){
                this.can_t_assist = false;
                const url = window.location.search;
                if (url !== ""){
                    window.location.replace(window.location.origin + window.location.pathname);
                }
            },
            urlInvalid(){
                this.invalid = false;
                const url = window.location.search;
                if (url !== ""){
                    window.location.replace(window.location.origin + window.location.pathname);
                }
            },
            assist(){
                const url = parseParamObj(window.location.href);
                if (url != ""){
                    let withExpiry = this.getWithExpiry("shareUrl")
                    let parseParamObj = {
                        ref : withExpiry,
                        ref2 : url.ref
                    }
                    let s = RsA_encryption(parseParamObj)
                    this.$http.put("/lucky/check",s).then(res => {
                        let {data, success} = res.data;
                        console.log("/lucky/check",res.data)
                        if (success){
                            if (data == "effective"){
                                this.showHelpSuccessNoJump = true
                            }
                        }else {
                            this.openError = true;
                        }
                    })
                }
            },
            closeSelf(){
                this.showClose = false;
                const url = window.location.search;
                if (url !== ""){
                    window.location.replace(window.location.origin + window.location.pathname);
                }
            },
            shareHandler() {
                this.loading1 = true;
                this.loading2 = true;
                let withExpiry = this.getWithExpiry("shareUrl");
                if (withExpiry != null) {
                    let mi = uuid.v4();
                    this.setWithExpiry("mi",mi,1800000)
                    this.update(mi);
                }
                // this.numFriends = 0
                this.showZaloPopup = true;  // 显示分享指南弹窗
                setTimeout(() => {
                    this.loading1 = false;
                }, 3000);
                setTimeout(() => {
                    this.loading2 = false;
                }, 6000);

            },
            handleShareSuccess(num) {
                // this.showZaloPopup3 = false
                // this.$message.success('复制成功！快去邀请好友助力！');
                let withExpiry = this.getWithExpiry("shareUrl");
                if (withExpiry != null) {
                    let parseParamObj1 ={
                        ref : withExpiry
                    } ;
                    let s = RsA_encryption(parseParamObj1)
                    this.$http.put("/lucky/upCount", s).then(res => {
                        let {data, success} = res.data;
                        if (success && data === "effective"){
                            this.showZaloPopup = false
                            if(num != 1){
                                this.showShareSuccess2 = true;
                            }

                        }
                    })
                }
            },
            handleShareSuccess2(num) {
                // this.showZaloPopup3 = false
                // this.$message.success('复制成功！快去邀请好友助力！');
                let withExpiry = this.getWithExpiry("shareUrl");
                let parseParamObj1 ={
                    ref : withExpiry
                }
                let s = RsA_encryption(parseParamObj1)
                this.$http.put("/lucky/upCount2", s).then(res => {
                    let {data, success} = res.data;
                    if (success && data === "effective"){
                        this.showZaloPopup3 = false

                        if(num != 1){
                            this.showShareSuccess2 = true;
                        }
                    }
                })
            },

            getUrl(){
                this.$http.get("/lucky/getUrl").then(res =>{
                    let {data, success,msg,code} = res.data;
                    if (success && data != null){
                        this.randomData = data[true];
                        this.notRandomData = data[false];

                    }else {
                        this.default = data
                    }
                }).catch(res => {
                    this.$message.error("网络异常");
                })
            },
            generateShareUrl() {

                if (this.randomData && Array.isArray(this.randomData) && this.randomData.length) {

                    const randomIndex = Math.floor(Math.random() * this.randomData.length);

                    const selectedRandomItem = this.randomData[randomIndex];

                    return  selectedRandomItem.shareUrl;
                }
            },
            copyText(num) {
                const text = this.shareUrl; // 或其他你需要复制的内容
                if (navigator.clipboard) {
                    // 使用现代 Clipboard API
                    navigator.clipboard.writeText(text).then(() => {
                        console.log('Text copied successfully!');
                        if (num == 1){
                            this.handleShareSuccess();
                        }else {
                            this.handleShareSuccess2();
                        }
                    }).catch(err => {
                        console.error('Failed to copy text: ', err);
                        const textarea = document.createElement('textarea');
                        textarea.value = text;
                        textarea.setAttribute('readonly', '');
                        textarea.style.position = 'absolute';
                        textarea.style.left = '-9999px';
                        document.body.appendChild(textarea);
                        textarea.select();
                        try {
                            document.execCommand('copy');
                            console.log('Text copied successfully!');
                            if (num == 1){
                                this.showZaloPopup = false
                                this.showShareSuccess = true;
                                this.handleShareSuccess(1);
                            }else {
                                this.showZaloPopup3 = false
                                this.showShareSuccess = true;
                                this.handleShareSuccess2(1);
                            }
                        } catch (err) {
                            console.error('Failed to copy text: ', err);
                        }
                        document.body.removeChild(textarea);
                    });
                } else {
                    // 使用老方法：创建临时的 textarea
                    this.$message.success('复制成功！邀请好友助力！');
                    const textarea = document.createElement('textarea');
                    textarea.value = text;
                    textarea.setAttribute('readonly', '');
                    textarea.style.position = 'absolute';
                    textarea.style.left = '-9999px';
                    document.body.appendChild(textarea);
                    textarea.select();
                    try {
                        document.execCommand('copy');
                        console.log('Text copied successfully!');
                        if (num == 1){
                            this.showZaloPopup = false
                            this.showShareSuccess = true;
                            this.handleShareSuccess(1);
                        }else {
                            this.showZaloPopup3 = false
                            this.showShareSuccess = true;
                            this.handleShareSuccess2(1);
                        }
                    } catch (err) {
                        console.error('Failed to copy text: ', err);
                    }
                    document.body.removeChild(textarea);
                }
            },
            shareHandler2() {
                this.loading1 = true;
                this.loading2 = true;
                let mi = uuid.v4();
                this.setWithExpiry("mi",mi)
                this.update(mi);
                this.showZaloPopup3 = true;  // 显示分享指南弹窗

                this.loading = true;
                setTimeout(() => {
                    this.loading1 = false;
                }, 3000);
                setTimeout(() => {
                    this.loading2 = false;
                }, 6000);
            },
            update(str){
                let withExpiry = this.getWithExpiry("shareUrl");

                if (withExpiry != null) {
                    let parseParamObj1 = {
                        ref : withExpiry,
                        mi : str
                    };

                    let s = RsA_encryption(parseParamObj1)
                    this.$http.put("/lucky/update2",s).then(res => {
                        let {data,success,msg,code} = res.data
                        if (success && data !=null){

                            this.LuckyShare = data
                            this.shareUrl = this.generateShareUrl() +"?ref="+parseParamObj1.mi
                            this.shareUrl = " [lucky-wheel] "+ this.generateShareUrl() +"?ref="+parseParamObj1.mi + " 欢迎参与我们的免费幸运大转盘抽奖活动！"
                            this.updateDataHref(this.shareUrl)
                            ZaloSocialSDK.reload()
                        }else {

                            this.shareUrl = this.generateShareUrl() +"?ref="+parseParamObj1.mi
                            this.shareUrl = " [lucky-wheel] "+ this.generateShareUrl() +"?ref="+withExpiry + " 欢迎参与我们的免费幸运大转盘抽奖活动！"
                            this.updateDataHref(this.shareUrl)
                            ZaloSocialSDK.reload()
                        }
                    })
                }
            },
            updateDataHref(newVal) {
                console.log("this.shareUrl",this.shareUrl)
                const zaloButton = document.getElementById('zaloShareButton');
                if (zaloButton) {
                    zaloButton.setAttribute('data-href', newVal);
                    ZaloSocialSDK.reload()
                }

            },
            // 抽奖结束会触发end回调
            endCallback(prize) {
                this.isPlayed = true;
                localStorage.setItem('isPlayed', 'true');
                if (prize.fonts[0].id === 1) {
                    this.maskFlag = true
                    localStorage.setItem("Hit",true)
                }
            },
            decrementLineup() {
                let now = new Date().getTime();
                let nextAllowedTime = parseInt(localStorage.getItem('nextDecrementTime'), 10);

                if (this.lineupNum > 1 && now >= nextAllowedTime) {
                    this.lineupNum -= 1; // 每次调用减少1人
                    localStorage.setItem('currentLineupNum', this.lineupNum); // 更新localStorage中的值

                    // 设置下一次允许减少的时间
                    let randomTime = Math.floor(Math.random() * 10000) + 1000; // 1到10秒之间的随机时间
                    localStorage.setItem('nextDecrementTime', now + randomTime);

                    this.decrementIntervalId = setTimeout(this.decrementLineup, randomTime);
                } else {
                    // 如果未到下一次减少时间，重新设置定时器
                    if (this.lineupNum > 1) {
                        let delay = nextAllowedTime - now;
                        this.decrementIntervalId = setTimeout(this.decrementLineup, delay);
                    }
                }
            },
            startDecrementProcess() {
                // 从localStorage中恢复排队人数或使用默认值
                let savedLineupNum = localStorage.getItem('currentLineupNum');
                this.lineupNum = savedLineupNum ? parseInt(savedLineupNum, 10) : 23333;

                // 检查是否有下一次允许减少时间设置
                if (!localStorage.getItem('nextDecrementTime')) {
                    localStorage.setItem('nextDecrementTime', new Date().getTime());
                }

                // 初始化减少过程
                this.decrementLineup(); // 直接开始第一次减少
            },
            saveProgress() {
                const progressData = {
                    trackingLogs: this.trackingLogs,
                    lastUpdateTime: this.lastUpdateTime,
                    allLogsDisplayed: this.allLogsDisplayed
                };
                localStorage.setItem('shippingProgress', JSON.stringify(progressData));
            },
            loadProgress() {
                const savedData = localStorage.getItem('shippingProgress');
                if (savedData) {
                    const progressData = JSON.parse(savedData);
                    this.trackingLogs = progressData.trackingLogs;
                    this.lastUpdateTime = progressData.lastUpdateTime;
                    this.allLogsDisplayed = progressData.allLogsDisplayed;
                }
            },
            checkAndUpdateProgress() {
                const currentTime = Date.now();
                this.trackingLogs.forEach((log, index) => {
                    if (currentTime >= log.time && !log.shown) {
                        log.shown = true;
                        this.saveProgress(); // Save each time a log is updated
                    }
                });
            },
            initiateShipping() {
                this.showShippingModal = true;
                this.loadProgress(); // Load progress when modal is initiated
                if (!this.allLogsDisplayed) {
                    this.checkAndUpdateProgress();
                }
            },
            closeModal() {
                this.showShippingModal = false;
            },
            //用户提交信息后初始化第二阶段的信息
            invite(){
                this.InviteParam.invitedCode  = this.getWithExpiry("shareUrl");
                let s = RsA_encryption(this.InviteParam);
                this.$http.post("/lucky/invite/InitInvite",s).then(res =>{
                    let {data, success,msg} = res.data;
                    if (success && data != null){
                        console.log("init！")
                    }
                })
            },
            // 表单提交
            submitHandler() {
                // 邮箱的正则表达式验证
                const emailPattern = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
                // 电话号码的正则表达式验证，假设最少6位数
                const mobilePattern = /^\d{6,}$/;

                if (!this.user.uname) {
                    this.errorMsg = "error：请填写姓名!";
                } else if (!this.user.province) {
                    this.errorMsg = "error：请填写省份!";
                } else if (!this.user.city) {
                    this.errorMsg = "error：请填写城市!";
                } else if (!this.user.address) {
                    this.errorMsg = "error：请填写地址!";
                } else if (!this.user.email) {
                    this.errorMsg = "error：请填写邮箱!";
                } else if (!emailPattern.test(this.user.email)) {
                    this.errorMsg = "error：邮箱格式不正确!";
                } else if (!this.user.mobile) {
                    this.errorMsg = "error：请填写电话!";
                }else if (!mobilePattern.test(this.user.mobile)) {
                    this.errorMsg = "error：电话号码不能少于6位!";
                }else {
                    this.errorMsg = "";
                    let withExpiry = this.getWithExpiry("shareUrl");
                    if (withExpiry != null) {
                        this.user.inviteCode = withExpiry;
                    }
                    let s = RsA_encryption(this.user)
                    this.$http.post("/lucky/user/register", s).then(res => {
                        let {data, success, msg} = res.data;
                        if (success) {
                            console.log("success！")
                            this.$message.success(data);
                            this.progressFlag = true;
                            if (this.decrementIntervalId == null){
                                this.startDecrementProcess();
                            }
                            this.showHelpSuccessFul = false;
                            this.iphoneFlag = false;
                            this.invite();
                            this.submitParam = true;
                            localStorage.setItem("progressFlag",true);
                            localStorage.setItem("showHelpSuccessful10",false);
                            localStorage.setItem("iphoneFlag",false);
                            localStorage.setItem("submitParam",true);
                        } else {
                            this.errorMsg = msg;
                        }
                    })
                }
            },
            //显示提交用户信息界面
            showInfo(){
                this.showHelpSuccessFul = true
            },
            //开始转盘游戏
            startCallback() {
                const isFirstPlay = localStorage.getItem('isFirstPlay') !== 'false';
                if (this.noPlay){
                    this.generateUniqueId();
                    this.noPlay = false;
                }
                this.$refs.myLucky.play()
                // 模拟调用接口异步抽奖
                if (this.numPrizes > 1) {
                    this.numPrizes--
                    localStorage.setItem('numPrizes', this.numPrizes.toString());
                    setTimeout(() => {
                        // 假设后端返回的中奖索引是0
                        const index = 3
                        // 调用stop停止旋转并传递中奖索引
                        this.$refs.myLucky.stop(index)
                    }, 3000)
                } else if (this.numPrizes == 1) {
                    this.numPrizes--
                    setTimeout(() => {
                        const index = 1
                        this.$refs.myLucky.stop(index)
                        localStorage.setItem('numPrizes', this.numPrizes.toString());
                    }, 3000)
                }
                if (isFirstPlay) {
                    let parseParamObj1 = parseParamObj(window.location.href);
                    if (parseParamObj1.ref != null && parseParamObj1.progress == null){
                        this.assist();
                    }
                    // Update the flag in local storage to indicate that the first play has occurred
                    localStorage.setItem('isFirstPlay', 'false');
                }
            },
            //完成转盘游戏，去领奖
            goiPhoneHandler(){
                let setFirstStage = {
                    ref : this.getWithExpiry("shareUrl") == null ? null : this.getWithExpiry("shareUrl")
                }
                let s = RsA_encryption(setFirstStage);
                this.$http.put("/lucky/setFirstStage",s).then(res => {
                    if (res.data.success){
                        console.log("已经玩过了，数据库设置为1")
                        localStorage.setItem("click",true);
                        this.wheelFlag = false;
                        this.iphoneFlag = true;
                        this.maskFlag = false;

                        const url = window.location.search;
                        if (url !== ""){
                            window.location.replace(window.location.origin + window.location.pathname);
                        }

                    }
                })
            },
            //生成唯一标识 + 动态邀请码
            async generateUniqueId() {
                try {
                    let withExpiry = this.getWithExpiry("shareUrl");
                    let parseParamObj1 = { ref: withExpiry ? withExpiry : null };
                    let s = RsA_encryption(parseParamObj1)
                    let response = await this.$http.put("/lucky/generateShare", s);
                    if (response.data.success) {
                        this.shareUrl = response.data.data.inviteCode;
                        this.setWithExpiry("shareUrl", this.shareUrl);
                        return this.shareUrl;
                    } else {
                        throw new Error("Failed to generate share URL");
                    }
                } catch (error) {
                    console.error("Error in generateUniqueId:", error);
                }
            },
            //存localStorage
            setWithExpiry(key, value) {
                const item = {
                    value: value
                };
                localStorage.setItem(key, JSON.stringify(item));
            },
            //从localStorage取值
            getWithExpiry(key) {
                const itemStr = localStorage.getItem(key);
                if (!itemStr) {
                    return null;
                }
                try {
                    const item = JSON.parse(itemStr);
                    return item.value;
                } catch (e) {
                    console.error("Error parsing JSON from localStorage:", e);
                    return null;
                }
            },
            //页面加载时第一时间先获取唯一标识码，并存localStorage。如果没有就调用方法生成，并存localStorage里面
            getInviteCodeInfo() {
                let ParseParamObj = {
                    ref : this.getWithExpiry("shareUrl") == null ? null : this.getWithExpiry("shareUrl")
                }
                let s = RsA_encryption(ParseParamObj)
                this.$http.put("/lucky/getInviteCodeInfo", s).then(res => {
                    let {data,success,msg,code} = res. data
                    if (success){
                        this.LuckyShare = data
                        if (this.LuckyShare.firstStage === true && this.LuckyShare.secondStage !== true){
                            this.wheelFlag = false
                            this.iphoneFlag = true
                            if (this.LuckyShare.verifyCount >= 3){
                                this.show1 = false
                            }
                            localStorage.setItem("isPlayed",true);
                            return
                        }
                        if (this.LuckyShare.secondStage === true){
                            this.progressFlag = true
                            this.wheelFlag = false
                        }else {
                            if (this.numPrizes != 0){
                                this.wheelFlag = true
                            }else {
                                if (JSON.parse(localStorage.getItem("click")) === true){
                                    this.iphoneFlag = true
                                    this.wheelFlag = false
                                }else {
                                    this.maskFlag = true
                                }
                            }
                        }
                    }else {
                        localStorage.clear()
                        // console.log("重新生成")
                        // this.generateUniqueId()
                        this.noPlay = true;
                    }
                })
            },
            scrollUp() {
                var box = document.getElementById("detetion-box2");
                var con1 = document.getElementById("detetion-con1");
                var con2 = document.getElementById("detetion-con2");
                if (con1.offsetHeight >= box.offsetHeight) {
                    con2.innerHTML = con1.innerHTML;
                    var timer1 = setInterval(scrol, this.speed);

                    function scrol() {
                        if (box.scrollTop >= con1.scrollHeight) {
                            box.scrollTop = 0;
                        } else {
                            box.scrollTop++;
                        }
                        if (box.scrollTop % 25 === 0) {
                            clearInterval(timer1);
                            setTimeout(() => {
                                timer1 = setInterval(scrol, 30);
                            }, 1000);
                        }
                    }
                }
            },
            //第一阶段的校验
            async verifyCode(ref) {
                this.startLoading()
                for (let i = 0; i < 10; i++) {
                    let withExpiry = this.getWithExpiry("shareUrl");
                    if (withExpiry) {
                        let parseParamObj = { ref: withExpiry, ref2: ref };
                        let s = RsA_encryption(parseParamObj)
                        this.$http.post("/lucky/recordClick2", s).then(res => {
                            let {data, success, msg, code} = res.data;
                            console.log(res.data);
                            if (success) {
                                switch (data) {
                                    case "self":
                                        this.showSelf = true;
                                        break;
                                    case "openDialog":
                                        if(this.numPrizes != 3){
                                            this.openFirstStage = true;
                                        }else{
                                            this.canAssist = true;
                                        }
                                        break;
                                    case "closeDialog":
                                        this.can_t_assist = true;
                                        break;
                                    case "closeItDialog":
                                        this.showIt = true;
                                        break;
                                    case "openFirstStage":
                                        this.openFirstStage = true;
                                        break;
                                    default:
                                        this.invalid = true;
                                        break;
                                }
                                this.stopLoading()
                            }
                        }).catch(error => {
                            console.error("API call failed:", error);
                        });
                        return;
                    } else {
                        await new Promise(resolve => setTimeout(resolve, 500)); // wait 500ms
                    }
                }
                console.error("Failed to retrieve shareUrl from localStorage after multiple attempts.");
            },
            //第二阶段的校验
            async verifyCodeStage2(ref) {
                for (let i = 0; i < 10; i++) {
                    let withExpiry = this.getWithExpiry("shareUrl");
                    if (withExpiry) {
                        let parseParamObj = { ref: withExpiry, ref2: ref };
                        let s = RsA_encryption(parseParamObj)
                        this.$http.post("/lucky/recordClick3", s).then(res => {
                            let {data, success, msg, code} = res.data;
                            console.log(res.data);
                            if (success) {
                                switch (data) {
                                    case "self":
                                        this.showSelf = true;
                                        break;
                                    case "openDialog":
                                        this.showDelivery = true;
                                        break;
                                    case "closeDialog":
                                        this.can_t_assist = true;
                                        break;
                                    case "closeItDialog":
                                        this.showIt = true;
                                        break;
                                    default:
                                        this.invalid = true;
                                        break;
                                }
                            }
                        }).catch(error => {
                            console.error("API call failed:", error);
                        });
                        return;
                    } else {
                        await new Promise(resolve => setTimeout(resolve, 500)); // wait 500ms
                    }
                }
                console.error("Failed to retrieve shareUrl from localStorage after multiple attempts.");
            },
            startPeriodicCheck() {
                this.intervalId = setInterval(this.fetchReferralCount, 15000); // Runs every 10 seconds
            },
            fetchReferralCount() {
                let withExpiry = this.getWithExpiry("shareUrl");
                let mi = this.getWithExpiry("mi");
                this.isPlayed = localStorage.getItem("isPlayed")
                if (withExpiry != null && this.isPlayed) {
                    let parseParamObj1 = {
                        ref : withExpiry
                    };
                    let s = RsA_encryption(parseParamObj1)
                    this.$http.put('/lucky/flushedCount2', s).then(response => {
                        let{data,success,msg} = response.data
                        this.LuckyShare = data
                        if (success){
                            if (data != null){
                                if (this.LuckyShare.verifyCount >= 3){
                                    if (this.LuckyShare.firstStage){
                                        this.show1 = false
                                    }
                                    if (this.LuckyShare.secondStage){
                                        if (this.LuckyShare.submitParam){
                                            if (this.decrementIntervalId == null){
                                                this.startDecrementProcess();
                                            }
                                            this.currentProgress = this.LuckyShare.inviteParam.effectiveCount

                                            if (this.LuckyShare.inviteParam.effectiveCount >= 100){

                                            }
                                        }else {
                                            this.$message.error("请提交资料")
                                        }
                                    }
                                }
                            }else{
                                localStorage.clear()
                                this.generateUniqueId()
                                window.location.reload();
                            }
                        }
                    });
                }
            },
            updateProgress() {
                // Check if the progress is less than 100 before incrementing
                if (this.currentProgress < this.totalLineup) {
                    this.currentProgress++;
                    setTimeout(this.updateProgress, 100);  // Continue incrementing
                }
            },
        },
        mounted() {
            this.getInviteCodeInfo();
            let withExpiry = this.getWithExpiry("shareUrl");
            if (withExpiry != null) {
                this.fetchReferralCount()
                this.startPeriodicCheck();
            }else {
                localStorage.clear()
                this.generateUniqueId()
            }
            this.scrollUp();
            this.getUrl();
            //加载页面时，判断用户处于哪个阶段
            let item = localStorage.getItem("numPrizes");
            if (item != null){
                this.numPrizes = item
            }else {
                this.numPrizes = 3
            }
            let item1 = localStorage.getItem("click");
            if (item != 0 && JSON.parse(item1) === true){
                this.maskFlag = false
            }
            //判断url
            let url = parseParamObj(window.location.search);
            if (url.progress){
                this.verifyCodeStage2(url.ref)
            }else {
                if (url.ref){
                    this.verifyCode(url.ref)
                }
            }
            setTimeout(() => {
                this.loading3 = false;
            }, 2000);

        },
        computed:{
            progressPercentage() {
                return (this.currentProgress / this.totalLineup) * 100;
            },
            isComplete() {
                return this.progressPercentage >= 100;
            }
        },
        watch: {
            shareUrl(newVal) {
                this.updateDataHref(newVal);
            },
            progressPercentage(newVal) {
                const fillContent = document.querySelector("#fillContent");
                const percent = document.querySelector("#percent");
                if(fillContent && percent) {
                    fillContent.style.width = newVal + '%';
                    percent.innerText = newVal.toFixed(0) + '%';
                }

                if (newVal >= 100) {
                    clearInterval(this.intervalId); // 清除定时器
                    this.intervalId = null; // 重置定时器ID
                }
            }
        },
        beforeDestroy() {
            if (this.decrementIntervalId) {
                clearInterval(this.decrementIntervalId);
            }
        },
        //    3853758560685742933
    })

</script>
</body>

</html>